import request from '@/utils/request'

// 查询生产任务列表
export function listTask(query) {
  return request({
    url: 'ldzl-sc/sc/task/list',
    method: 'get',
    params: query
  })
}

// 获取工序任务详情
export function getWorkOrderTask(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}`,
    method: 'get'
  })
}

// 获取工序任务物料清单
export function getTaskMaterials(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}/materials`,
    method: 'get'
  })
}

// 获取工序任务报工记录
export function getTaskReports(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}/reports`,
    method: 'get'
  })
}

// 获取工序任务退料记录
export function getTaskReturns(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}/returns`,
    method: 'get'
  })
}

// 获取工序任务执行进度
export function getTaskProgress(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}/progress`,
    method: 'get'
  })
}

// 获取工序任务派工信息
export function getTaskDispatch(taskId) {
  return request({
    url: `/ldzl-sc/workOrderTask/${taskId}/dispatch`,
    method: 'get'
  })
}